home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!seacloud.demon.co.uk
- From: Ben Ashley <Ben@seacloud.demon.co.uk>
- Newsgroups: comp.lang.c++
- Subject: Variable Problems
- Date: Fri, 05 Jan 96 17:57:56 GMT
- Organization: home, in Leicester, England
- Message-ID: <820864676snz@seacloud.demon.co.uk>
- Reply-To: Ben@seacloud.demon.co.uk
- X-NNTP-Posting-Host: seacloud.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.29
- X-Mail2News-Path: seacloud.demon.co.uk
-
- Hi,
-
- I am very new to C++, and for my first project I decided to develop and MS-DOS
- game. A friend recommended MSVC, and so I purchased that. I have got the
- hang of classes and such like, and the GUI for the game is going very well and
- it even has mouse support.
-
- The only problem Im having, is that some variables seem to be getting over
- written during execution, without me saying so. Using Codeview, I have
- determined that this is happening after excessive class calls (ie, a line of
- code is accessing several classes within classes many times). The variables
- that are getting over written are members of the same parent class as the
- classes which seem to be killing them. Judging by the new value of the
- variable I don't want to be changed at that point, I think the value may be
- coming from a member of the aforementioned class calls.
-
- I have checked the code throughly, and found, as I suspected, that I have only
- set these variables once (in a constructor), and not again afterwards. I was
- wondering if anybody out there knew why this was happening, and if there were
- any more checks or a solution I could use to stop it happening.
-
- Sorry if its obvious. if anyone needs to look at the class definitions, I can
- post (or Email) them.
-
- Hope somebody can help!
-
- --
- Cheers,
-
- Ben
-
- ------------------====### legal notice ###====-----------------------
- Microsoft Network is prohibited from redistributing this work in any
- form,in whole or in part. License to distribute this post is available to
- Microsoft for $499. Posting without permission constitutes an agreement to
- these terms.
-